package com.heima.admin.controller;

import com.heima.api.IAuthClient;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.ApUserRealnameDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
@Slf4j
public class AuthenticationController {
    @Autowired
    private IAuthClient iAuthClient;

    /**
     * 作者认证列表
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public PageResponseResult authList(@RequestBody ApUserRealnameDto dto){
        return iAuthClient.authList(dto);
    }

    /**
     * 驳回申请
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody ApUserRealnameDto dto){
        return iAuthClient.authFail(dto);
    }

    /**
     * 申请通过
     * @param dto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody ApUserRealnameDto dto){
        return iAuthClient.authPass(dto);
    }
}
